<template>
  <div class="loading-mask" v-if="visible">
    <div class="loading-spinner">
      <i class="el-icon-loading"></i>
      <p>{{ text }}</p>
    </div>
  </div>
</template>

<script setup>
defineProps({
  visible: Boolean,
  text: {
    type: String,
    default: '加载中...'
  }
})
</script>

<style scoped>
.loading-mask {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-spinner {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
}

.loading-spinner i {
  font-size: 30px;
  color: #0097ff;
}

.loading-spinner p {
  margin: 10px 0 0;
  font-size: 14px;
  color: #666;
}
</style> 